package client.intellijboy.demo;

import open.intellijboy.core.properties.IntellijProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 描述：hellowrld控制器
 *
 * @author intellijboy
 * @since 1.0
 */
@RestController
@RequestMapping("demo")
@Slf4j
public class HelloWorldController {

    private IntellijProperties intellijProperties;

    public HelloWorldController(@Autowired(required = false) IntellijProperties intellijProperties) {
        this.intellijProperties = intellijProperties;
    }

    @GetMapping("hello")
    public String sayHello() {
        return "hello:" + intellijProperties.getUserName();
    }

}
